
<template>
	<view class="content ">
		<view class="content-box1">
			<text class="">
				区代理片区
			</text>
			<view class="content-flex">
				<view class="content-item">
					<view class="content-image">
						<image src="../../static/yemian/num.png" mode=""></image>
					</view>
					<view class="color-text">
						总返利
					</view>
					<view class="size-text">
						100
					</view>
				</view>
				<view class="content-item">
					<view class="content-image">
						<image src="../../static/yemian/maring.png" mode=""></image>
					</view>
					<view class="color-text">
						购买金额
					</view>
					<view class="size-text">
						3.2W
					</view>
				</view>
				<view class="content-item">
					<view class="content-image">
						<image src="../../static/yemian/leiji.png" mode=""></image>
					</view>
					<view class="color-text">
						购买张数
					</view>
					<view class="size-text">
						3600
					</view>
				</view>
			</view>
			<view class="btn-text">
				<view class="btn-image">
					<image src="../../static/yemian/map.png" mode=""></image>
				</view>
				 地址：四川省成都市金牛区
			</view>
		</view>
		
		<view class="content-box1">
			<text class="">
				区代理片区
			</text>
			<view class="content-flex">
				<view class="content-item">
					<view class="content-image">
						<image src="../../static/yemian/num.png" mode=""></image>
					</view>
					<view class="color-text">
						总返利
					</view>
					<view class="size-text">
						100
					</view>
				</view>
				<view class="content-item">
					<view class="content-image">
						<image src="../../static/yemian/maring.png" mode=""></image>
					</view>
					<view class="color-text">
						购买金额
					</view>
					<view class="size-text">
						3.2W
					</view>
				</view>
				<view class="content-item">
					<view class="content-image">
						<image src="../../static/yemian/leiji.png" mode=""></image>
					</view>
					<view class="color-text">
						购买张数
					</view>
					<view class="size-text">
						3600
					</view>
				</view>
			</view>
			<view class="btn-text">
				<view class="btn-image">
					<image src="../../static/yemian/map.png" mode=""></image>
				</view>
				 地址：四川省成都市金牛区
			</view>
		</view>


		<!-- <shopro-picker ref="shoproCity" :pickerValueDefault="cityPickerValueDefault" @onCancel="onCancel" @onConfirm="onConfirm"></shopro-picker> -->
	</view>
</template>

<script>
	export default {
		components: {
			
		},

		data() {
			return {
			};
		},
		
		
		onShow() {
			
		},
		onLoad() {
			this.mshpCrd();
			this.my_card();

		},
		methods: {
			// onCancel(e) {
			// 	this.addressData.area_id = e.cityCode;
			// 	this.area_text = e.label;
			// },

			// jump(path, parmas) {
			// 	this.$Router.push({
			// 		path: path,
			// 		query: parmas,
			// 	});
			// },
			// onConfirm(e) {
			// 	console.log('确定选择后的事件', e.cityCode)
			// 	this.addressData.area_id = e.cityCode;
			// 	this.area_text = e.label;


			// 	//this.modalName1 = true;

			// 	this.addr = e.label; //cityCode
			// 	this.address_id = e.cityCode; //cityCode
			// },
			

			//我购买的会员卡
			async mshpCrd() {
				const res = await this.$api('my_card_list', {
					cardnumber: this.cardnumber
				});
				this.data = res.data.data;

				if (this.data.length == 0) {
					this.emptyShow = true;
				}
				console.log('res*9*9 :>> ', this.data);
			},

			async pay(order_number) {
				const res = await this.$api('prepay', {
					order_sn: order_number,
					payment: 'wechat',
					type: 'buyka',
				});
				console.log('res************************* :>> ', res);

				uni.requestPayment({
					provider: 'wxpay',
					timeStamp: res.data.pay_data.timeStamp,
					nonceStr: res.data.pay_data.nonceStr,
					package: res.data.pay_data.package,
					signType: res.data.pay_data.signType,
					paySign: res.data.pay_data.paySign,
					success: res => {
						console.log('success:支付成功' + JSON.stringify(res));
						this.modalName1 = false;

						this.my_card();
						this.mshpCrd();

						

						// 清空输入框
						this.addr = '';
						// 显示弹框
						if (this.userInfo.agent_live > 1) {
							this.modalName3 = true
						}

					},
					fail: err => {
						console.log('fail:' + JSON.stringify(err));
					},
				});
			},

			
			async my_card() {
				// const res = await this.$api('my_card');
				// this.card_num = res.data.card_num;
				// this.discount = res.data.discount;
				// this.user_card_live = res.data.user_card_live;
				// console.log('this.card_num :>> ', this.card_num);
				// this.kaliveinfo = res.data.kaliveinfo; // name price

			},

		},
		
	};
</script>

<style lang="scss" scoped>
	.content {
		background-color: #F9F9F9;
		height: 100vh;
		font-family: PingFang SC;
		// padding-right: 24rpx;
		
		image {
			width: 100%;
			height: 100%;
		}
		
		.content-box1 {
			// width: 100%;
			height: 360rpx;
			border-radius: 20rpx;
			margin: 30rpx 24rpx 0 24rpx;
			background-color: #FFFFFF;
			
			text {
				width: 90%;
				display: block;
				font-size: 32rpx;
				font-weight: 700;
				text-align: center;
				padding: 36rpx 0;
				font-family: PingFang SC;
			}
			
			.content-flex {
				width: 100%;
				display: flex;
				justify-content: space-around;
				
				.content-item {
					width: 200rpx;
					text-align: center;
					
					.color-text {
						color: #666666;
						margin: 18rpx 0;
						font-size: 24rpx;
					}
					
					.size-text {
						color: #666666;
						font-size: 32rpx;
					}
				}
				
				.content-image {
					width: 62rpx;
					height: 62rpx;
					margin: 0 auto;
				}
			}
			
			.btn-text {
				color: #999999;
				font-size: 22rpx;
				display: flex;
				align-items: center;
				margin: 20rpx 0 0 30rpx;
				
				.btn-image {
					margin-right: 7rpx;
					width: 24rpx;
					height: 24rpx;
				}
			}
		}
	}
</style>
